<?php
session_start();
/**************************
 * # Woordenschat App     *
 **************************/

// Directory separator shortcut
define('DS', DIRECTORY_SEPARATOR);

// Set the base path
define('DIR_BASE', dirname(__FILE__).DS);

// Set the path to classes
define('DIR_DATABASE', DIR_BASE.'database'.DS);
define('DIR_MODELS', DIR_BASE.'models'.DS);
define('DIR_CONTROLLERS', DIR_BASE.'controllers'.DS);

// Load the classes with the loader
require_once(DIR_BASE.'loader.php');

// Initialize a connection with the database
import('database.*');
Database::init('woordenschat');

// Import packages
import('models.*');
import('controllers.*');

// Import other essential classes
import('filter');
import('request');
import('view');

// Execute the application
$task = Request::getVar('task');
$controller = new Controller();
$controller->execute($task);

// Close connection with the database
Database::close();

?>